$(function() {

    if (method === 'accommodation') {
        $("#pikame").PikaChoose({showCaption: false, autoPlay: false, carousel: true})
        $("#tabs").tabs({active: 0});
    }

    $('#question_form').validate({
        errorElement: "em",
        submitHandler: function(form) {

            $('#question button').attr('disabled', 'disabled');
            $("#question").mask(lang['dtl_posting_question'] + "...");
            form = $('#question_form');
            accomm_id = $('#hotel_id').val();
            var serialize = form.serialize();
            $.ajax({
                url: lang_url + '/question/accom-' + accomm_id + '?' + serialize + '&ajax=true',
                method: 'get',
                success: function(data) {

                    $("#question").unmask();
                    alert(lang['dtl_posting_thanks'] + ".");
                    return false;
                }
            });
            return false;
        }
    });

    $("#priceList").on('click', function() {
        if ($(this).hasClass('active') === false) {
            $('.priceListTable').slideDown();
            $(this).addClass('active');
        } else {
            $('.priceListTable').slideUp();
            $(this).removeClass('active');
        }

        return false;
    });


    if (method !== 'changedates') {

        $('.show_more').on('click', showMe);

    }
    
    $('.info table').addClass('table table-striped table-bordered table-condensed table-hover mytable');
});